<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>窗口事件</title>
</head>
<body>
<!--onblur	当窗口失去焦点时运行脚本。-->
<!--onfocus	当窗口获得焦点时运行脚本。-->
<!--onload	当文档加载之后运行脚本。-->
<!--onresize	当调整窗口大小时运行脚本。-->
<script>
    window.onblur = function () {
        console.log("窗口失去焦点")
        console.log("----------")
    }
    window.onfocus = function () {
        console.log("窗口获得焦点")
        console.log("----------")
    }
    window.onload = function () {
        console.log("文档加载完成")
        console.log("----------")
    }
    window.onresize = function () {
        console.log("窗口大小改变")
        console.log("----------")
    }
</script>
</body>
</html>